<template>
  <div class="PayModel">
    <div class="title">
      {{ title }}
      <el-icon @click="onClose"><Close /></el-icon>
    </div>
    <!-- 主体 -->
    <div class="Cbody">
      <div class="money"><span>¥&ensp;</span>{{ money }}</div>
      <div class="qrCode">
        <img :src="qrCodeImg || qrCode" />
      </div>
      <div class="tips">微信扫一扫，立即支付</div>

      <div class="close" v-if="slot">
        <slot name="reFresh" />
      </div>

      <div v-else class="close" @click="onClose">返回重新选择购买</div>
    </div>
  </div>
</template>

<script setup>
import qrCode from "./assets/qrcode.svg";

defineProps({
  title: {
    type: String,
    default: () => "微信支付",
  },
  tips: {
    type: String,
    default: () => "此操作将删除该条数据，是否继续？",
  },
  slot: {
    type: Boolean,
    default: () => false,
  },
  qrCodeImg: {
    type: String,
    default: () => "",
  },
  money: {
    type: String || Boolean,
    default: () => 0,
  },
});

const emit = defineEmits(["close", "submit"]);

const onClose = () => emit("close");

const onSumbit = () => emit("submit");
</script>
<style scoped lang="less">
@import "./style";
</style>
